<%@page import="systems.AdsSystem"%>
<%@page import="helpers.StringHelper"%>
<%@page import="java.util.List"%>
<%@page import="helpers.UrlHelper"%>
<%@page import="entities.IpAddress"%>
<%
String error = (String) request.getAttribute("error");
IpAddress ipAddress = (IpAddress) request.getAttribute("ipAddress");

//Set content for Seo
String title = "Reverse IP - a " + UrlHelper.getDomainServer(request) + " tool FREE";
String description = "Reverse IP allow you to find info of domain name hosted on IP. This is a " + UrlHelper.getDomainServer(request) + " tool FREE";
String keywords = "reverse ip lookup, reverse ip trace, reverse ip lookup, reverse ip locator, check info";
String url = UrlHelper.getServerUrl(request) + "/rip";

if (ipAddress != null) {
	title = "Reverse IP Address " + ipAddress.getIp() + " information in " + UrlHelper.getDomainServer(request);
	description = "Ip Address " + ipAddress.getIp() + " has location in country " + ipAddress.getCountryName() + ", it put in  city " + ipAddress.getCity()
					+ ". There are many site same " + ipAddress.getIp() + " as " + StringHelper.listToString(ipAddress.getDomains(), ", ", 6);
	keywords = ipAddress.getIp() + ", " + keywords;
	url = url + "?q=" + ipAddress.getIp();
}
%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<jsp:include page="/layouts/header.jsp">
	<jsp:param name="title" value="<%=title %>" />
    <jsp:param name="description" value="<%=description %>" />
    <jsp:param name="keywords" value="<%=keywords %>" />
    <jsp:param name="ogtitle" value="<%=title %>" />
    <jsp:param name="ogurl" value="<%=url %>" />
    <jsp:param name="ogdescription" value="<%=description%>" />
</jsp:include>

		<div class="row-fluid">
		
			<div class="span8">
				<div class="row-fluid">
					<section>
						<div class="block2">
							<div class="title-block">
								<h3>Reverse Ip</h3>
								<div class="divider-arrow"></div>
							</div>
							<div class="content-block">
								<form action="/rip" class="input-append" id="search">
									<input type="text" role="textbox" class="xlarge ui-autocomplete-input" id="artist_search" name="q" placeholder="ex: 74.125.128.113" value="">
									<input class="btn search-bt" type="submit" value="">
								</form>
							</div>
							
							<hr />
							<% if (ipAddress != null) { %>
							<h4>Ip <%=ipAddress.getIp() %> Info</h4>
							<div class="adv top-right">
								<%=AdsSystem.getAds468x15() %>
							</div>
							<div class="row-fluid">
								<div class="span6 ip-result">
									<ul class="item-list">
										<li class="row-fluid">
											<div class="span4">Country Code</div>
											<div class="span8"><%=ipAddress.getCountryCode() %></div>
										</li>
										<li class="row-fluid">
											<div class="span4">Country Code3</div>
											<div class="span8"><%=ipAddress.getCountryCode3() %></div>
										</li>
										<li class="row-fluid">
											<div class="span4">Country Name</div>
											<div class="span8"><%=ipAddress.getCountryName() %></div>
										</li>
										<li class="row-fluid">
											<div class="span4">City</div>
											<div class="span8"><%=ipAddress.getCity() %></div>
										</li>
										<li class="row-fluid">
											<div class="span4">Continent Code</div>
											<div class="span8"><%=ipAddress.getContinentCode() %></div>
										</li>
										<li class="row-fluid">
											<div class="span4">Latitude</div>
											<div class="span8"><%=ipAddress.getLatitude() %></div>
										</li>
										<li class="row-fluid">
											<div class="span4">Longitude</div>
											<div class="span8"><%=ipAddress.getLongitude() %></div>
										</li>
									</ul>
								</div>
								<div class="span6">
									<img src="http://maps.google.com/maps/api/staticmap?sensor=false&size=300x300&markers=size:mid|color:blue|label:1|<%=ipAddress.getLatitude() %>,<%=ipAddress.getLongitude() %>&markers=color:black|label:0|<%=ipAddress.getLatitude() %>,<%=ipAddress.getLongitude() %>">
								</div>
							</div>
							
							<div class="row-fluid f-info">
								<div class="span12">
									<div class="adv center">
										<%=AdsSystem.getAds468x60() %>
									</div>
									<h4>Site same <%=ipAddress.getIp() %> Info</h4>
									<ul class="col4 clearfix">
										<%
										List<String> domains = ipAddress.getDomains();
										for (int i = 0; i < domains.size(); i++) {
										%>
										<li>
											<a href="/www/<%=domains.get(i)%>"><%=domains.get(i)%></a>
										</li>
										<% } %>
									</ul>
								</div>
							</div>
							<% } %>
						</div>
						
					</section>
					
				</div>
			</div>
			
			<jsp:include page="/elements/right.jsp" />
		</div>
	
<jsp:include page="/layouts/footer.jsp" />